﻿@model Jb.Web.ViewModels.FeedbackViewModel
@using Jb.Web.Utility;
@using Jb.Common.DB;

@{
	String pageTitle = "Send Feedback";    
    ViewBag.Title = Html.GetPageTitle(pageTitle);
    bool _HasSent = NullHandler.GetBoolean(ViewData[AppConstants.ViewDataKeys.SUB_MODEL]);
}

<div class="jb-page-heading">
    <h1>@pageTitle</h1>
    <div>
        Send your feedback directly to the @ConfigReader.SiteName team.        
    </div>
</div>

<div class="jb-page-content">
@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

	if (Model == null)
    {
        @: @Html.ErrorMessageBox("Sorry! Requested Feedback was not found for edit.")
    }
	else
	{
        if (ViewData[AppConstants.ViewDataKeys.SUB_MODEL] != null)
        {
            if (_HasSent)
            {
                @: @Html.InfoMessageBox("Your Feedback has sent succussfully.")            
            }
            else
            {
                @: @Html.WarningMessageBox("Sorry! We were unable to send your Feedback. There was an error in the SMTP Server. Our technical team has been notified about this problem. Please try after some time.")
            }
        }
		
		@*<div class="GroupHeaderOverlay" style="width:140px;">Feedback Information</div>*@    

		<div class="editor-label">
			@Html.LabelFor(model => model.Name)
		</div>
		<div class="editor-field">
			@Html.TextBoxFor(model => model.Name)
			@Html.ValidationMessageFor(model => model.Name)
		</div>
		<div class="editor-label">
			@Html.LabelFor(model => model.Email)
		</div>
		<div class="editor-field">
			@Html.TextBoxFor(model => model.Email)
			@Html.ValidationMessageFor(model => model.Email)
		</div>
        <div class="editor-label">
			@Html.LabelFor(model => model.Subject)
		</div>
		<div class="editor-field">
			@Html.TextBoxFor(model => model.Subject, new { @class="jb-long-text"})
			@Html.ValidationMessageFor(model => model.Subject)
		</div>
		<div class="editor-label">
			@Html.LabelFor(model => model.Message)
            <div class="jb-label-hint">
                Write a brief a description about what you want to know from us.
            </div>
		</div>
		<div class="editor-field">
            <div>
			@Html.TextAreaFor(model => model.Message, new { @class="jb-long-text"})
            </div>
            <div>@Html.ValidationMessageFor(model => model.Message)</div>			
		</div>			
		<div>
			<button type="submit" class="btn btn-primary"><i class="icon-question-sign icon-white"></i> Send</button>
		</div>		
    }
}
</div>

@section RightSideBar{
<div style="min-height:200px;"></div>
}


@section JavaScriptPlaceHolder
{
@Html.JavaScript("jquery.validate.min.js", Url)
@Html.JavaScript("jquery.validate.unobtrusive.min.js", Url)
}

